package com.iscas.dataaggregation.domain.experiment;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 
 * @TableName otel_traces
 */
@TableName(value ="otel_traces")
@Data
public class OtelTraces implements Serializable {
    /**
     * 
     */
    private Date timestamp;

    /**
     * 
     */
    private Object traceid;

    /**
     * 
     */
    private Object spanid;

    /**
     * 
     */
    private Object parentspanid;

    /**
     * 
     */
    private Object tracestate;

    /**
     * 
     */
    private Object spanname;

    /**
     * 
     */
    private Object spankind;

    /**
     * 
     */
    private Object servicename;

    /**
     * 
     */
    private Object resourceattributes;

    /**
     * 
     */
    private Object spanattributes;

    /**
     * 
     */
    private Integer duration;

    /**
     * 
     */
    private Object statuscode;

    /**
     * 
     */
    private Object statusmessage;

    @TableField(value = "`Events.Timestamp`")
    private List<String> eventsTimestamp;

    @TableField(value = "`Events.Name`")
    private List<String> eventsName;

    @TableField(value = "`Events.Attributes`")
    private List<Map<String, String>> eventsAttributes;

    @TableField(value = "`Links.TraceId`")
    private List<String> linksTraceId;

    @TableField(value = "`Links.SpanId`")
    private List<String> linksSpanId;

    @TableField(value = "`Links.TraceState`")
    private List<String> linksTraceState;

    @TableField(value = "`Links.Attributes`")
    private List<Map<String, String>> linksAttributes;
    /**
     * 
     */
    private Object netsockpeeraddr;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        OtelTraces other = (OtelTraces) that;
        return (this.getTimestamp() == null ? other.getTimestamp() == null : this.getTimestamp().equals(other.getTimestamp()))
            && (this.getTraceid() == null ? other.getTraceid() == null : this.getTraceid().equals(other.getTraceid()))
            && (this.getSpanid() == null ? other.getSpanid() == null : this.getSpanid().equals(other.getSpanid()))
            && (this.getParentspanid() == null ? other.getParentspanid() == null : this.getParentspanid().equals(other.getParentspanid()))
            && (this.getTracestate() == null ? other.getTracestate() == null : this.getTracestate().equals(other.getTracestate()))
            && (this.getSpanname() == null ? other.getSpanname() == null : this.getSpanname().equals(other.getSpanname()))
            && (this.getSpankind() == null ? other.getSpankind() == null : this.getSpankind().equals(other.getSpankind()))
            && (this.getServicename() == null ? other.getServicename() == null : this.getServicename().equals(other.getServicename()))
            && (this.getResourceattributes() == null ? other.getResourceattributes() == null : this.getResourceattributes().equals(other.getResourceattributes()))
            && (this.getSpanattributes() == null ? other.getSpanattributes() == null : this.getSpanattributes().equals(other.getSpanattributes()))
            && (this.getDuration() == null ? other.getDuration() == null : this.getDuration().equals(other.getDuration()))
            && (this.getStatuscode() == null ? other.getStatuscode() == null : this.getStatuscode().equals(other.getStatuscode()))
            && (this.getStatusmessage() == null ? other.getStatusmessage() == null : this.getStatusmessage().equals(other.getStatusmessage()))
            && (this.getEventsTimestamp() == null ? other.getEventsTimestamp() == null : this.getEventsTimestamp().equals(other.getEventsTimestamp()))
            && (this.getEventsName() == null ? other.getEventsName() == null : this.getEventsName().equals(other.getEventsName()))
            && (this.getEventsAttributes() == null ? other.getEventsAttributes() == null : this.getEventsAttributes().equals(other.getEventsAttributes()))
            && (this.getLinksTraceId() == null ? other.getLinksTraceId() == null : this.getLinksTraceId().equals(other.getLinksTraceId()))
            && (this.getLinksSpanId() == null ? other.getLinksSpanId() == null : this.getLinksSpanId().equals(other.getLinksSpanId()))
            && (this.getLinksAttributes() == null ? other.getLinksAttributes() == null : this.getLinksAttributes().equals(other.getLinksAttributes()))
            && (this.getLinksTraceState() == null ? other.getLinksTraceState() == null : this.getLinksTraceState().equals(other.getLinksTraceState()))
            && (this.getNetsockpeeraddr() == null ? other.getNetsockpeeraddr() == null : this.getNetsockpeeraddr().equals(other.getNetsockpeeraddr()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode());
        result = prime * result + ((getTraceid() == null) ? 0 : getTraceid().hashCode());
        result = prime * result + ((getSpanid() == null) ? 0 : getSpanid().hashCode());
        result = prime * result + ((getParentspanid() == null) ? 0 : getParentspanid().hashCode());
        result = prime * result + ((getTracestate() == null) ? 0 : getTracestate().hashCode());
        result = prime * result + ((getSpanname() == null) ? 0 : getSpanname().hashCode());
        result = prime * result + ((getSpankind() == null) ? 0 : getSpankind().hashCode());
        result = prime * result + ((getServicename() == null) ? 0 : getServicename().hashCode());
        result = prime * result + ((getResourceattributes() == null) ? 0 : getResourceattributes().hashCode());
        result = prime * result + ((getSpanattributes() == null) ? 0 : getSpanattributes().hashCode());
        result = prime * result + ((getDuration() == null) ? 0 : getDuration().hashCode());
        result = prime * result + ((getStatuscode() == null) ? 0 : getStatuscode().hashCode());
        result = prime * result + ((getStatusmessage() == null) ? 0 : getStatusmessage().hashCode());
        result = prime * result + ((getEventsTimestamp() == null) ? 0 : getEventsTimestamp().hashCode());
        result = prime * result + ((getEventsName() == null) ? 0 : getEventsName().hashCode());
        result = prime * result + ((getEventsAttributes() == null) ? 0 : getEventsAttributes().hashCode());
        result = prime * result + ((getLinksTraceId() == null) ? 0 : getLinksTraceId().hashCode());
        result = prime * result + ((getLinksSpanId() == null) ? 0 : getLinksSpanId().hashCode());
        result = prime * result + ((getLinksAttributes() == null) ? 0 : getLinksAttributes().hashCode());
        result = prime * result + ((getLinksTraceState() == null) ? 0 : getLinksTraceState().hashCode());
        result = prime * result + ((getNetsockpeeraddr() == null) ? 0 : getNetsockpeeraddr().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", timestamp=").append(timestamp);
        sb.append(", traceid=").append(traceid);
        sb.append(", spanid=").append(spanid);
        sb.append(", parentspanid=").append(parentspanid);
        sb.append(", tracestate=").append(tracestate);
        sb.append(", spanname=").append(spanname);
        sb.append(", spankind=").append(spankind);
        sb.append(", servicename=").append(servicename);
        sb.append(", resourceattributes=").append(resourceattributes);
        sb.append(", spanattributes=").append(spanattributes);
        sb.append(", duration=").append(duration);
        sb.append(", statuscode=").append(statuscode);
        sb.append(", statusmessage=").append(statusmessage);
        sb.append(", events.timestamp=").append(eventsTimestamp);
        sb.append(", events.name=").append(eventsName);
        sb.append(", events.attributes=").append(eventsAttributes);
        sb.append(", links.traceid=").append(linksTraceId);
        sb.append(", links.spanid=").append(linksSpanId);
        sb.append(", links.tracestate=").append(linksTraceState);
        sb.append(", links.attributes=").append(linksAttributes);
        sb.append(", netsockpeeraddr=").append(netsockpeeraddr);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}